clear all; close all;clc;
R=1.25*4;
C=33e-12;
tau=R*C;

f=10e7;
% Ось времени
T = 1 /10000/f;
t = 0:T:(15 * 1/f);
lt = length(t);

% Выделение памяти
Uv = nan(1, lt);

A = [0; 1; 2; 3];
U = nan(length(A), lt);
Uv(1)=0; 
for n = 1:length(A)
E = A(n)*cos(2*pi*f*t);

for k=2:lt

Uv(k)=(abs(E(k))+(tau/T)*Uv(k-1))/(tau/T+1);

end;
U(n,:)=Uv;
end;
figure(1);
plot(t*1e9, [E;abs(E);U;]);
xlabel('t, ns')
ylabel('E, U, Volt')
legend('E(t|A=3)', 'U(t|A=3)', 'U(t|A=0)', 'U(t|A=1)', 'U(t|A=2)')
grid on

